Function block diagrams for use with programmable controllers are defined in IEC standard 1131-3, which is hereby incorporated by reference. Other programming languages covered by that standard include Ladder Diagrams (based on diagrammatic conventions typically used to represent relay-based systems) and Structured Text (based on text conventions typically used to represent sequential operations in a digital computer).
A function block diagram is a normalized two dimension representation of an executable program such as may be implemented in a digital process control system or other digital computer, and typically consists of one or more disconnected networks, each comprising a number of connected inputs, outputs, function blocks and functions.
A function block exists as a particular instance associated with one or more specified variables which persist from one evaluation of that instance to the next, while a function has no such persistent variables. In turn, a higher level function block may include not only inputs and outputs, but also one or more functions and lower level function blocks, and a higher level function may contain one or more lower level functions. Accordingly, a function block diagram typically represents an ongoing process that involves multiple executions of related processes and outputs that vary in response to not only changes in external inputs, but also the passage of time.
One specific application of an IEC 1131-3 function block diagram or other 1131-3 programming language is to provide an application programmer with a convenient means to define a program for operating the three redundant programmable controller modules of a critical control and safety system such as the Tricon.TM. Version 9 single chassis safety control system in which the same application program is developed and downloaded to three isolated parallel digital processors. Since digital control processors operate in a sequential fashion and all three processors must produce the same output at any given time, a sequential evaluation order must be assigned to the individual blocks and functions such that each iteration of the program produces a predictable set of output values. In particular, a valid IEC 1131-3 Function Block Diagram cannot include any closed loops (feedback) within a single evaluation cycle, although any persistent variable evaluated during a particular evaluation cycle can be used as an input variable during a subsequent evaluation cycle.
A topological sort is a known mathematical process for mapping a partially ordered set (which may be represented by a multi-dimensional graph of nodes connected by directional paths) onto a completely ordered (i.e., one-dimensional) set of relationships. These and other related techniques are discussed at length in Discrete Mathematics in Computer Science by Donald F. Stanat and David F. McAllister, which is hereby incorporated by reference.